﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Simple.Repository.Migrations
{
    public partial class _18 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "Desc",
                table: "GardenHouseClassRoom",
                type: "longtext",
                nullable: true,
                comment: "教室描述",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "教室描述")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<bool>(
                name: "CRoomState",
                table: "GardenHouseClassRoom",
                type: "tinyint(1)",
                nullable: false,
                comment: "教室状态",
                oldClrType: typeof(bool),
                oldType: "tinyint(1)",
                oldComment: "教室状态(1-启用，2停用)");

            migrationBuilder.AlterColumn<string>(
                name: "CRoomName",
                table: "GardenHouseClassRoom",
                type: "longtext",
                nullable: true,
                comment: "教室名称",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "教室名称")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "CRoomCode",
                table: "GardenHouseClassRoom",
                type: "longtext",
                nullable: true,
                comment: "教室编号",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "教室编号")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "CRoomAddress",
                table: "GardenHouseClassRoom",
                type: "longtext",
                nullable: true,
                comment: "教室地址或位置",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldComment: "教室地址或位置")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.UpdateData(
                table: "GardenHouseClassRoom",
                keyColumn: "Desc",
                keyValue: null,
                column: "Desc",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "Desc",
                table: "GardenHouseClassRoom",
                type: "longtext",
                nullable: false,
                comment: "教室描述",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "教室描述")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<bool>(
                name: "CRoomState",
                table: "GardenHouseClassRoom",
                type: "tinyint(1)",
                nullable: false,
                comment: "教室状态(1-启用，2停用)",
                oldClrType: typeof(bool),
                oldType: "tinyint(1)",
                oldComment: "教室状态");

            migrationBuilder.UpdateData(
                table: "GardenHouseClassRoom",
                keyColumn: "CRoomName",
                keyValue: null,
                column: "CRoomName",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "CRoomName",
                table: "GardenHouseClassRoom",
                type: "longtext",
                nullable: false,
                comment: "教室名称",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "教室名称")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "GardenHouseClassRoom",
                keyColumn: "CRoomCode",
                keyValue: null,
                column: "CRoomCode",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "CRoomCode",
                table: "GardenHouseClassRoom",
                type: "longtext",
                nullable: false,
                comment: "教室编号",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "教室编号")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "GardenHouseClassRoom",
                keyColumn: "CRoomAddress",
                keyValue: null,
                column: "CRoomAddress",
                value: "");

            migrationBuilder.AlterColumn<string>(
                name: "CRoomAddress",
                table: "GardenHouseClassRoom",
                type: "longtext",
                nullable: false,
                comment: "教室地址或位置",
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true,
                oldComment: "教室地址或位置")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");
        }
    }
}
